package com.dp.system.service.impl;

import java.util.List;
import com.dp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dp.system.mapper.SysGreenhouseMapper;
import com.dp.system.domain.SysGreenhouse;
import com.dp.system.service.ISysGreenhouseService;

/**
 * 大棚Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-10
 */
@Service
public class SysGreenhouseServiceImpl implements ISysGreenhouseService 
{
    @Autowired
    private SysGreenhouseMapper sysGreenhouseMapper;

    /**
     * 查询大棚
     * 
     * @param greenhouseId 大棚主键
     * @return 大棚
     */
    @Override
    public SysGreenhouse selectSysGreenhouseByGreenhouseId(Long greenhouseId)
    {
        return sysGreenhouseMapper.selectSysGreenhouseByGreenhouseId(greenhouseId);
    }

    /**
     * 查询大棚列表
     * 
     * @param sysGreenhouse 大棚
     * @return 大棚
     */
    @Override
    public List<SysGreenhouse> selectSysGreenhouseList(SysGreenhouse sysGreenhouse)
    {
        return sysGreenhouseMapper.selectSysGreenhouseList(sysGreenhouse);
    }

    /**
     * 新增大棚
     * 
     * @param sysGreenhouse 大棚
     * @return 结果
     */
    @Override
    public int insertSysGreenhouse(SysGreenhouse sysGreenhouse)
    {
        sysGreenhouse.setCreateTime(DateUtils.getNowDate());
        return sysGreenhouseMapper.insertSysGreenhouse(sysGreenhouse);
    }

    /**
     * 修改大棚
     * 
     * @param sysGreenhouse 大棚
     * @return 结果
     */
    @Override
    public int updateSysGreenhouse(SysGreenhouse sysGreenhouse)
    {
        sysGreenhouse.setUpdateTime(DateUtils.getNowDate());
        return sysGreenhouseMapper.updateSysGreenhouse(sysGreenhouse);
    }

    /**
     * 批量删除大棚
     * 
     * @param greenhouseIds 需要删除的大棚主键
     * @return 结果
     */
    @Override
    public int deleteSysGreenhouseByGreenhouseIds(Long[] greenhouseIds)
    {
        return sysGreenhouseMapper.deleteSysGreenhouseByGreenhouseIds(greenhouseIds);
    }

    /**
     * 删除大棚信息
     * 
     * @param greenhouseId 大棚主键
     * @return 结果
     */
    @Override
    public int deleteSysGreenhouseByGreenhouseId(Long greenhouseId)
    {
        return sysGreenhouseMapper.deleteSysGreenhouseByGreenhouseId(greenhouseId);
    }
}
